<template>
  <div class="db-test">
    <label>商品名称：</label>
    <el-input v-model="goodsName" style="width:200px;"></el-input>
    <el-button @click="clickEF" type="primary">EF访问数库</el-button>
    <el-button @click="clickDapper" type="success">Dapper访问数库</el-button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      goodsName: '戴尔DELL成就3400'
    };
  },
  methods: {
    clickEF() {
      let url = 'api/dbTest/ef?goodsName=' + this.goodsName;
      this.http.get(url, {}, true).then((x) => {
        this.$Message.info(x);
      });
    },
    clickDapper() {
      let url = 'api/dbTest/dapper?goodsName=' + this.goodsName;
      this.http.get(url, {}, true).then((x) => {
        this.$Message.info(x);
      });
    }
  }
};
</script>

<style lang="less" scoped>
.db-test {
  display: flex;
  padding: 100px;
  line-height: 34px;
  button {
    margin-left: 15px;
  }
}
</style>
